<%@ Page Language="C#" AutoEventWireup="true" CodeFile="delegatesmanagement.aspx.cs"
    Inherits="PHSRAG.Insight21.COI.DelegatesManagement" %>

<%@ Register TagPrefix="cc2" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>
<%@ Register TagPrefix="cc1" Namespace="PHSRAG.Insight21.InsightWebControls" Assembly="PHSRAG.Insight21.InsightWebControls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Delegates Management</title>
    <link href="../Insight21.css" type="text/css" rel="stylesheet" />    <script language="javascript" type="text/javascript">
    </script>

</head>
<body>
    <form id="delegateManagement" runat="server">
        <table class="Container" cellpadding="0">
            <tr>
                <td>
                    <table cellspacing="0" width="100%">
                        <tr>
                            <td>
                                <cc1:Header ID="header" runat="server"></cc1:Header>
                            </td>
                        </tr>
                        <tr style="display: none">
                            <td>
                                <cc1:CoISubNavigation ID="coiSubNavigation" runat="server"></cc1:CoISubNavigation>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:COIAdminSubNavigation ID="coiAdminSubNavigation" runat="server"></cc1:COIAdminSubNavigation>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc2:BreadCrumb ID="breadCrumb" runat="server" HighlightCurrentPage="true"></cc2:BreadCrumb>
                            </td>
                        </tr>
                    </table>
                    <table bgcolor="#ffffff" width="100%" cellpadding="3" cellspacing="3">
                        <tr>
                            <td>
                                <table width="98%" class="Container" >
                                    <tr >
                                        <td >
                                            <table width="100%" class="Search">
                                                <tr>
                                                    <td colspan="8" class="OrangeLabel" >
                                                        <b>Supervisor Search</b></td>
                                                </tr>
                                                <tr>
                                                    <td align="right">
                                                        Last Name:</td>
                                                    <td align="left">
                                                        <asp:TextBox runat="server" ID="lastName" CssClass="flattextbox"></asp:TextBox></td>
                                                    <td align="right">
                                                        Organization:</td>
                                                    <td align="left">
                                                        <asp:DropDownList ID="organization" runat="server" AutoPostBack="true" CssClass="FlatDropDown"
                                                            OnSelectedIndexChanged="OnOrganizationSelectionChanged">
                                                        </asp:DropDownList></td>
                                                    <td rowspan="4" valign="top">
                                                        <cc1:CommonSearch ID="commonSearch" HideAllCommonControls="true" OnSearch="OnSearch"
                                                            OnClearSelection="OnClearSelection" runat="server" Module="COI" ExtendedSearchControl="coISearch">
                                                        </cc1:CommonSearch>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">
                                                        First Name:</td>
                                                    <td align="left">
                                                        <asp:TextBox ID="firstName" runat="server" CssClass="flattextbox"></asp:TextBox></td>
                                                    <td rowspan="2" valign="top" align="right">
                                                        Dept/Unit:</td>
                                                    <td rowspan="2" align="left">
                                                        <asp:ListBox ID="deptUnit" Width = "300" SelectionMode="Multiple" runat="server" CssClass="FlatDropDown">
                                                        </asp:ListBox></td>
                                                </tr>
                                                <tr>
                                                    <td align="right">
                                                        User Name:</td>
                                                    <td align="left">
                                                        <asp:TextBox ID="userName" runat="server" CssClass="flattextbox"></asp:TextBox></td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <cc1:SearchCriteriaDisplay ID="searchCriteriaDisplay" runat="server"></cc1:SearchCriteriaDisplay>
                                                    </td>
                                                </tr>
                                            </table>
                                            <table width= "100%" bgcolor = "#e9ebe9" >
                                                <tr>
                                                    <td>
                                                        <cc2:ExpandingPanel ID="helpContainer" runat="server" ExpansionToggler="instructionToggler">
                                                            <StaticTemplate>
                                                                <table width="100%" class="Search">
                                                                    <tr>
                                                                        <td>
                                                                            <cc2:ExpansionToggler ID="instructionToggler" runat="Server" ExpandedImage="~/Images/Arrow_DN.gif"
                                                                                CollapsedImage="~/Images/Arrow_RT.gif" ExpandedLinkCaption="Hide Instructions"
                                                                                CollapsedLinkCaption="Show Instructions"></cc2:ExpansionToggler>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </StaticTemplate>
                                                            <DynamicTemplate>
                                                                <table class="SearchDynamic">
                                                                    <tr>
                                                                        <td>
                                                                            Items you see here have already been added to the database at the time the submitter
                                                                            was filling out their COI.&nbsp;&nbsp;Make sure the spelling is accurate and that
                                                                            there is not a duplicate item.&nbsp;&nbsp;Then check <span style="color: #c46606;
																				font-weight: bold;">Accept</span>
                                                                            to keep this item available for others to use in the future.&nbsp;&nbsp;Check <span style="color: #c46606; font-weight: bold;">
																			Reject</span> to prevent this item from being used in the future.&nbsp;&nbsp;Then
                                                                            click the <span style="color: #c46606; font-weight: bold;">Update button</span> to save your changes.
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </DynamicTemplate>
                                                        </cc2:ExpandingPanel>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table><br />                             
                                            <table class="Container">
                                                <tr>
                                                    <td>
                                                        <table class="Search" id="delegateSelection" cellspacing="3" cellpadding="2">
                                                            <tr>
                                                                <td align="left" rowspan="3">
                                                                    To Add a delegate for a "Supervisor", enter search criteria above and click "Search"
                                                                    button.<br />
                                                                    This action will load the list of supervisor(s) in the dropdown matching the criteria.<br />
                                                                    Selecting a supervisor from the dropdown and clicking "Get Delegates" will display
                                                                    the list of delegated for the supervisor selected.
                                                                    <br />
                                                                </td>
                                                                <td align="right">
                                                                    <asp:DropDownList runat="server" ID="supervisor" CssClass="FlatDropDown">
                                                                    </asp:DropDownList></td>
                                                                <td valign="middle" align="right">
                                                                    <asp:ImageButton ID="fetchDelegates" ImageAlign="Middle" runat="server" ImageUrl="~/Images/b_getdelegates.jpg"
                                                                        OnClick="OnFetchDelegates"></asp:ImageButton>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                      </td>
                                                 </tr>
                                             </table>                                                   
                                            <table class="Invisible" cellspacing="0" id="dynamicTable" width = "100%">
                                                <tr>
                                                    <td>
                                                        <cc2:Annunciator ID="annunciator" ContainerID="dynamicTable" runat="server"></cc2:Annunciator>
                                                        <br />
                                                        <cc2:ActivityIndicator ID="activityIndicator" ContainerID="dynamicTable" runat="server">
                                                        </cc2:ActivityIndicator>
                                                        <cc2:PostbackGuard ID="postbackGuard" runat="server"></cc2:PostbackGuard>
                                                    </td>
                                                </tr>
                                            </table>
                                            <br />
                                            <asp:Panel ID="gridContainer" Visible="false" runat="server">
                                                <table width="100%" cellspacing="0" class="Container">
                                                    <tr>
                                                        <td>
                                                            <table class="DataTitle" width="100%">
                                                                <tr>
                                                                    <td>
                                                                        &nbsp;Search Results</td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <cc2:Pager ID="topPager" runat="server"></cc2:Pager>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:DataGrid CellSpacing="0" ID="searchResults" runat="server" CssClass="DataGrid"
                                                                AllowCustomPaging="true" AutoGenerateColumns="False" Width="100%" AllowSorting="true"
                                                                AllowPaging="true">
                                                                <FooterStyle CssClass="DataGridHeader"></FooterStyle>
                                                                <AlternatingItemStyle CssClass="DataGridAlternatingItem"></AlternatingItemStyle>
                                                                <ItemStyle CssClass="DataGridItem"></ItemStyle>
                                                                <HeaderStyle CssClass="DataGridHeader"></HeaderStyle>
                                                                <Columns>
                                                                    <asp:TemplateColumn Visible="False" HeaderText="ID">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="delegateId" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.DelegateId")%>'>
                                                                            </asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateColumn>
                                                                    <asp:BoundColumn SortExpression="LastName" HeaderText="Name" DataField="Name" ReadOnly="True">
                                                                    </asp:BoundColumn>
                                                                    <asp:BoundColumn SortExpression="UserName" HeaderText="User Name" DataField="UserName"
                                                                        ReadOnly="True"></asp:BoundColumn>
                                                                    <asp:BoundColumn SortExpression="Organization" HeaderText="Organization > Dept >Unit"
                                                                        DataField="Organization" ReadOnly="True"></asp:BoundColumn>
                                                                    <asp:TemplateColumn HeaderText="Remove" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                                        <ItemTemplate>
                                                                            <asp:CheckBox runat="server" ID="removeDelegate" AutoPostBack="False"></asp:CheckBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateColumn>
                                                                </Columns>
                                                                <PagerStyle Visible="False"></PagerStyle>
                                                            </asp:DataGrid></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height: 19px">
                                                            <cc2:Pager ID="bottomPager" runat="server"></cc2:Pager>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:ImageButton ID="addDelegate" runat="server" Visible="false" AlternateText="Add Delegate" ImageUrl="~/Images/b_add_delegates.gif"
                                                OnClientClick="window.open('AddDelegates.aspx?showHearder=0', 'AddDelegates', 'width=800, height=600, status=yes,scrollbars = yes, toolbar=no, resizable=yes'); return false;" />&nbsp;&nbsp;
                                            <asp:ImageButton ID="removeSelectedDelegate" runat="server" Visible="false" AlternateText="Remove Selected Delegate"
                                                ImageUrl="~/Images/b_remove_delegate.gif" OnClick="OnRemoveSelectedDelegate" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>                
    </form>
</body>
</html>
